const { defineConfig } = require('@vue/cli-service')
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = defineConfig({
  // outputDir: "build",
  // assetsDir: "static",
  productionSourceMap: false,
  lintOnSave: true,
  transpileDependencies: true,
  devServer: {
    port: process.env.VUE_APP_PORT || 8080,
    open: JSON.parse(process.env.VUE_APP_OPEN || 'true'),
    setupMiddlewares: require('./mock')
  },
  css: {
    loaderOptions: {
      scss: {
        additionalData: `@import "@/assets/styles/variables.scss";`
      }
    }
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ]
  }
})

